using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using samples.domain.Entities;
using samples.infrastructure;

namespace samples.api.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class OrdersController : ControllerBase
    {
        private readonly ILogger<OrdersController> _logger;

        public OrdersController(ILogger<OrdersController> logger)
        {
            _logger = logger;
        }

        [HttpGet("v1")]
        public IEnumerable<Order> Get1([FromServices] AppDbContext context)
        {
            Task.Delay(100000).Wait();
            yield return new Order();
        }


        [HttpGet("v2")]
        public IEnumerable<Order> Get2([FromServices] AppDbContext context)
        {
            yield return new Order();
        }

        [HttpGet("v3")]
        public IEnumerable<Order> Get3([FromServices] AppDbContext context)
        {
            yield return new Order();
        }
    }
}